package com.damuzee.core.web.springmvc;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.servlet.view.freemarker.FreeMarkerView;

public class RichFreeMarkerView extends FreeMarkerView {

	/**
	 * 部署路径属性名称
	 */
	public static final String CONTEXT_PATH = "base";
	public static final String SOURCE_PATH = "res";

	/**
	 * 在model中增加部署路径base，方便处理部署路径问题。
	 */
	
	protected void exposeHelpers(Map<String,Object> model, HttpServletRequest request)
			throws Exception {
		super.exposeHelpers(model, request);
		model.put(CONTEXT_PATH, request.getContextPath());
		model.put(SOURCE_PATH, request.getContextPath() + "/res");
	}



}
